<div class="window document-add">
	<div class="title">New document</div>
	<div class="content">
		<?php echo $form->create('Document'); ?>
			<?php echo $form->input('name', array('style' => 'width: 300px;')); ?>
			<?php echo $form->input('text', array('id' => 'EditTextDocument', 'label' => false)); ?>
			<div class="submit">
			<?php echo $form->submit('Preview', array('name' => 'data[submit]', 'div' => false)); ?>
			<?php echo $form->submit('Save', array('name' => 'data[submit]', 'div' => false)); ?>
			</div>
		<?php echo $form->end(); ?>
	</div>
</div>
<?php if (!empty($preview)) : ?>
<div class="window document-preview">
	<div class="title">View document - <?php echo $this->data['Document']['name']; ?></div>
	<div class="content">
		<h1><?php echo $this->data['Document']['name']; ?></h1>
		<div>
			<?php echo $this->data['Document']['text']; ?>
		</div>
	</div>
</div>
<?php endif; ?>
<script>
	CKEDITOR.replace( "EditTextDocument",{
		toolbar : [
			{ name: 'clipboard', items : [ 'Cut','Copy','Paste','PasteText','PasteFromWord','-','Undo','Redo' ] },
			{ name: 'editing', items : [ 'Find','Replace' ] },
			{ name: 'insert', items : [ 'Image','Table','HorizontalRule','SpecialChar'] },
			{ name: 'basicstyles', items : [ 'Bold','Italic','Strike' ] },
			{ name: 'paragraph', items : [ 'NumberedList','BulletedList','-','Outdent','Indent','-','Blockquote' ] },
			{ name: 'links', items : [ 'Link','Unlink' ] },
		]
	});
</script>
